package hyy_2022;

/**
 * x平方根整数部分
 *
 */
public class _0721_69_Sqrt {

    public static int sqrt(int x) {
        if(x == 0) {
            return 0;
        }
        int ans = (int)Math.exp(0.5*Math.log(x));
        return (long)(ans+1)*(ans+1) <= x ? ans+1 : ans;
    }


    public static void main(String[] args) {
        System.out.println(sqrt(4));
    }
}
